package com.ken.spring.beans;

import com.ken.spring.Car;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.sql.DataSource;
import java.sql.SQLException;

public class Main {
    public static void main(String[] args) throws SQLException {

        ApplicationContext ctx = new ClassPathXmlApplicationContext("beans-jdbc.xml");

        DataSource dataSource = (DataSource) ctx.getBean("dataSource");

        System.out.println(dataSource.getConnection());

//        Car car = (Car) ctx.getBean("car2");
//        Car car3 = (Car) ctx.getBean("car3");
//        System.out.println(car);
//        System.out.println(car3);


    }
}
